import { AxiosResponse } from 'axios'
import { LoginFrom } from '@/types/views/login'
import { ResponseData } from '@/types/api/public'
import request from '@/request'


/**
 * @desc: 获取角色信息
 * @param { Object } 
 */
export const getRoleData = (data: LoginFrom) => {  
    return request({
        url: '/role',
        method: 'get',
        params:data
    })
}



/* *
*@desc: 修改角色信息
* @param { Object } 
*/
export const putRoleData = (data: LoginFrom) => {
    let datas = {...data}
    return request({
    url: '/role/'+datas['id'],
    method: 'put',
    data:{...datas}
    })
}

/* @desc: 角色信息删除
* @param { Object } 
*/
export const delRoleData = (data: LoginFrom) => {
    return request({
        url: '/role/'+data,
        method: 'delete',
    })
}
/* @desc: 角色信息添加
* @param { Object } 
*/
export const postRoleData = (data: LoginFrom) => {
    let datas = {...data}
    return request({
        url: '/role/',
        method: 'post',
        data:{...datas}
    })
}